using System.Collections.Generic;

public partial class StockApiDataController
{
    public class StockApiResponse
    {
        public string msg;
        public int code;
        public bool success => code == 20000;
    }
    public class GetAllStocksResponse:StockApiResponse
    {
        public List<StockApiStockData> data;
    }
    
    public class StockApiStockData
    {
        public string api_code;
        public string name;
        public string jys;

        public static StockData StockApiStockData2StockData(StockApiStockData stockApiStockData)
        {
            return new StockData()
            {
                dm = stockApiStockData.api_code,
                jys = stockApiStockData.jys,
                mc = stockApiStockData.name
            };
        }
    }
}